//
//  productCommentCollectionViewCell.m
//  tabBarText
//
//  Created by tsb1119 on 2017/6/30.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "productCommentCollectionViewCell.h"
@interface productCommentCollectionViewCell()
@property (weak, nonatomic) IBOutlet UIButton *deleteBtn;

@property (weak, nonatomic) IBOutlet UIImageView *add_img;
@property (weak, nonatomic) IBOutlet UIView *placeholdView;
@property (weak, nonatomic) IBOutlet UILabel *addLab;

@end
@implementation productCommentCollectionViewCell
-(void)setDataWithImage:(UIImage *)image deleteBtnHidden:(BOOL)deleteBtnHidden
{
    self.selectImg.image=deleteBtnHidden?nil:image;
    self.selectImg.contentMode = UIViewContentModeScaleAspectFill;
    self.selectImg.clipsToBounds = YES;
    _deleteBtn.alpha=0.8;
    _deleteBtn.hidden = deleteBtnHidden;
    _placeholdView.hidden = !deleteBtnHidden;
    
}
-(void)awakeFromNib
{
    [super awakeFromNib];
    [_deleteBtn addTarget:self action:@selector(deletePhoto) forControlEvents:UIControlEventTouchUpInside];
    _addLab.text = @"添加图片".rh_localized;
}

-(void)deletePhoto
{
    self.deleteBack();
}

@end
